<!DOCTYPE html>
<html class="no-js">
<head>
	<meta charset="utf-8">
	<title>{BEESCRM:$found['name']}</title>
	<meta name="description" content="">
	<meta name="HandheldFriendly" content="True">
	<meta name="MobileOptimized" content="320">
	<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
	<meta http-equiv="cleartype" content="on">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" type="text/css" href="/assets/base/found/css/common.css">
	<link rel="stylesheet" type="text/css" href="/assets/base/found/css/index.css">
	<link rel="stylesheet" type="text/css" href="/assets/base/found/css/font.css">
	<link rel="stylesheet" href="/assets/base/repair/js/sweetalert/lib/sweet-alert.css">
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script type="text/javascript">
    	wx.config({
			debug: false,
			appId: "{BEESCRM:$appid}",
			timestamp: "{BEESCRM:$timestamp}",
			nonceStr: "{BEESCRM:$noncestr}",
			signature: "{BEESCRM:$signature}",
			jsApiList: ['checkJsApi','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo'],
		});
    	wx.ready(function(){
    		var url = '{BEESCRM:$share_url}';
    		var imgUrl = '{BEESCRM:$share_image}';
    		var title = '{BEESCRM:$share_title}';
    		var desc = '{BEESCRM:$share_desc}';
    		//分享到朋友圈
    		wx.onMenuShareTimeline({
    			title: title, // 分享标题
    			link: url, // 分享链接
    			imgUrl: imgUrl, // 分享图标
    			success: function () { 
    				share(); 
    			},
    			cancel: function () { 
    				// 用户取消分享后执行的回调函数
    				/* alert('已取消'); */
    			}
    		});
    		//发送给好友
    		wx.onMenuShareAppMessage({
    			title: title, // 分享标题
    			desc: desc, // 分享描述
    			link: url, // 分享链接
    			imgUrl: imgUrl, // 分享图标
    			success: function () { 
    				// 用户确认分享后执行的回调函数
    				//share();
    			},
    			cancel: function () { 
    				// 用户取消分享后执行的回调函数
    			}
    		});
    	});
    </script>	
</head>
<body>
<div class="wraper">
	<!--<div class="head">
		<a href="javascript:history.back(-1);" class="iconfont icon-fanhui72"></a>
		<span class="head-name">拾金不昧光荣榜</span>
	</div>-->
	<div class="honor-box">
		<a href="javascript:history.back(-1);" class="iconfont icon-fanhui72"></a>
		<!--无记录-->
		<!--<div class="no-list">
			<p class="iconfont icon-biaoqingnf"></p>
			<p class="tips">还未有人上榜哦，敬请期待</p>
			<p>拾金不昧 争做活雷锋！</p>
		</div>-->


		<volist name="data" id="vo" offset="0" length='6'>
		<div class="tb-mode record-list">
			<div class="tb-cell record">
			<if condition="$i eq 1">
				<img src="/assets/base/found/images/first.png"/>
			<elseif condition="$i eq 2"/>
				<img src="/assets/base/found/images/second.png"/>
			<elseif condition="$i eq 3"/>	
				<img src="/assets/base/found/images/third.png"/>
			<else/>
				# {BEESCRM:$i}
			</if>
			</div>
			<div class="tb-cell honor-mes">
				<p class="top-honor">{BEESCRM:$vo.username}<if condition="$vo['role'] eq 1">（学生）
					<elseif condition="$vo['role'] eq 2"/>（教职工）
					<elseif condition="$vo['role'] eq 3"/>（来宾）
					<else/>（其他）</if>
					<a href="javascript:void(0);" <if condition="$vo['honor_praise'] neq 1">class="pull-right praise gray-zan"<else/>class="pull-right praise"</if> data-id="{BEESCRM:$vo.honor_id}"><span id="zan_num">{BEESCRM:$vo.praise}</span><span class="iconfont icon-iconfontpraise"></span></a></p>
				<p>近期拾金不昧次数：{BEESCRM:$vo.number}次</p>
			</div>
		</div>
		</volist>
		<a href="javascript:void(0);" class="more">点击加载更多</a>
		<input type="hidden" id="count" value="{BEESCRM:$count}">
		<input type="hidden" id="z_count" value="{BEESCRM:$z_count}">
	</div>
	<div class="bottom-box">
		<p class="copyright">杭州青橄榄网络技术有限公司 技术支持</p>
	</div>
</div>
<script src="/assets/base/found/js/jquery-2.1.0.min.js"></script>
<script src="/assets/base/repair/js/sweetalert/lib/sweet-alert.min.js"></script>
<script src="/assets/base/repair/js/jq.utils.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
	$(document).ready(function () {
		$(document).on('click','.praise',function(){
			var json={};
			var data={};
			var _this = $(this);
			data.honor_id=$(this).data('id');
			json.data=data;
			json.url="{BEESCRM::U('/base/Lost/doPraise',array('lost_id'=>$lostId))}";
			json.method='post';
			json.type='json';
			$.getAjax(json,false,praise,'');

			function praise(data){
				var id=data.data;
				var num = data.number;
				_this.find('#zan_num').html(num);
				if(id==1){
					_this.removeClass('gray-zan');
				}
				else{
					_this.addClass('gray-zan');
				}
			}
		});
	});

	var data_count=$('#count').val();
	var z_count=$('#z_count').val();
	if(data_count<6 || z_count==6){
		$('.more').hide();
	}
	$(document).click('.more',function () {
		$('.more').hide();
		var json={};
		var data={};
		data.count=$('#count').val();
		json.data=data;
		json.url="{BEESCRM::U('/base/Lost/doGetHonor',array('lost_id'=>$lostId))}";
		json.method='post';
		json.type='json';
		$.getAjax(json,false,update,'');
	});
	function update(data){
		var list=data.data;
		var count=data.count;
		var check_count=$('#z_count').val();
		var html='';
		var praise='';
		$.each(list, function (key, node) {
			if(node.honor_praise==1){
				praise="pull-right praise";
			}else{
				praise="pull-right praise gray-zan";
			}
			html = '<div class="tb-mode record-list"> <div class="tb-cell record"> #' +key+
			'</div> <div class="tb-cell honor-mes"> <p class="top-honor">'+node.username+'（'+node.role_name+'）'+
			'<a href="javascript:void(0);" class="'+praise+'" data-id="'+node.honor_id+'"><span id="zan_num">'+node.praise+'</span><span class="iconfont icon-iconfontpraise"></span></a></p><p>近期拾金不昧次数：'+node.number+
			'次</p></div></div>'
			$('.honor-box').append(html);
			praise='';
		});
		if(count % 6 == 0 && check_count > count){
			html='<a href="javascript:void(0);" class="more">点击加载更多</a>'
			$('.honor-box').append(html);
		}
		$('#count').val(count);
	}
    $(window).load(function(){
        $('.load').hide();
    });

    var nav_h = $('.nav-box').outerHeight();
    $('.wraper').css("paddingBottom",nav_h);
    $('.reply-box').css("bottom",nav_h);
	var height = $(window).height();
	var head_height = $('.head').height()
	$('.honor-box').css("minHeight",height-head_height);
	var height = $(window).height();
	var bottombox_height = $('.bottom-box').outerHeight();
	$('.wraper').css("minHeight",height);
	$('.honor-box').css("paddingBottom",bottombox_height);
</script>
</body>
</html>
